home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Magazine
/
Online
/
httpproxy
/
checkport.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-08-20
|
737b
|
41 lines
/* Check whether one of several ARexx ports is already up */
call addlib('rexxsupport.library', 0, -30, 0)
parse arg AllArgs
do forever
parse VAR AllArgs Name AllArgs
if Name == "" then
leave
/* Check lonly port name and all names with .0 to .9 extensions */
do i=-1 to 9
if i > -1 then
n = Name'.'i
else
n = Name
call CheckPort(n)
if i > -1 then
n = upper(Name)'.'i
else
n = upper(Name)
call CheckPort(n)
end
end
exit 20 /* no port found */
/* we do that by trying and opening one Name after another */
CheckPort: procedure
parse Arg n
myport = openport(n)
if myport = 0 then /* port is already there */
exit 0
call closeport(n)
return